// =====================================================================================
//  Copyright (C) 2024 by Jiaxing Shao. All rights reserved

//  文 件 名:  VertexBufferLayout.h
//  作    者:  Jiaxing Shao, 980853650@qq.com
//  创建时间：  2024-08-01 22:10
//  描    述:  
// =====================================================================================
#pragma once

#include <vector>

struct VertexBufferElement {
    unsigned int  location;
    int           count;
    unsigned int  type;
    unsigned int  offset;
    unsigned char normalized;
};

class VertexBufferLayout {
public:
    VertexBufferLayout(unsigned int stride);
    ~VertexBufferLayout();

public:
    unsigned int getStride() const;
    void         addAttribute(unsigned int location, int count, unsigned int type, unsigned int offset, unsigned char normalized = 0);
    std::vector<VertexBufferElement> const &getAttributes() const;

private:
    unsigned int                     m_bufferStride;
    std::vector<VertexBufferElement> m_vecAttributes;
};